<html>
<head><meta charset="utf-8"><title>Saving MMX registers · project-inline-asm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/index.html">project-inline-asm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html">Saving MMX registers</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204925487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204925487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bernard Kolobara <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204925487">(Jul 24 2020 at 14:53)</a>:</h4>
<p>Hi! The rfc for the new inline asm says that the MMX registers are not currently supported, so I can't mark them as clobbered. But is there a way of saving them? Like pushing them to the stack. <code>push mm0</code> gives me a "invalid operand for instruction" error.</p>



<a name="204925764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204925764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204925764">(Jul 24 2020 at 14:55)</a>:</h4>
<p>The x86 push instruction doesn't support mmx registers.</p>



<a name="204926000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204926000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204926000">(Jul 24 2020 at 14:57)</a>:</h4>
<p>You can explicitly store MMX registers to the stack by allocating stack space with <code>sub esp, 8</code></p>



<a name="204926041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204926041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204926041">(Jul 24 2020 at 14:57)</a>:</h4>
<p>Why exactly do you need this?</p>



<a name="204926316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204926316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bernard Kolobara <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204926316">(Jul 24 2020 at 14:59)</a>:</h4>
<p>Trying to recreate this libfringe llvm_asm: <a href="https://github.com/edef1c/libfringe/blob/master/src/arch/x86_64.rs#L223">https://github.com/edef1c/libfringe/blob/master/src/arch/x86_64.rs#L223</a></p>



<a name="204926358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204926358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204926358">(Jul 24 2020 at 14:59)</a>:</h4>
<p>I <em>think</em> you can probably ignore the mmx registers.</p>



<a name="204926971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Saving%20MMX%20registers/near/204926971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Saving.20MMX.20registers.html#204926971">(Jul 24 2020 at 15:03)</a>:</h4>
<p>You'll probably also want to ignore <code>xmm16</code> to <code>xmm31</code> since those are only available with AVX512.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>